﻿using UnityEngine;
using System.Collections;

public class Popup_Tutorial : Popup_Base
{
    TutorialKind m_Kind;
    public UITexture m_Texture;   

    public void SetPopupWithTutorialKind(TutorialKind kind)
    {
        m_Kind = kind;
        string textureName = TextController.GetStringWithId(kind.ToString());       
        m_Texture.mainTexture = ResourceLoader.Load(string.Format("Tutorial/Img/{0}", textureName)) as Texture2D;
    }

    public override void ButtonTouch(Collider collider)
    {
        switch (collider.gameObject.name)
        {
            case "Button_OK":                
                BackButton();
                break;
            case "Button_Back":               
                BackButton();
                break;
        }
    }

    public override void BackButton()
    {
        PopupManager.PopPopup();

        if (m_MessageRecieaver_OK != null && m_Message_OK != null)
            m_MessageRecieaver_OK.SendMessage(m_Message_OK);
    }
}